package com.cxm.server.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cxm.server.pojo.Position;
import com.cxm.server.mapper.PositionMapper;
import com.cxm.server.service.PositionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cxm
 * @since 2021-04-28
 */
@Service
public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> implements PositionService {

    @Autowired
    private PositionMapper positionMapper;

    /**
     * 根据职位名称获取职位
     * @param name
     * @return
     */
    @Override
    public Position getPosByName(String name) {
        return positionMapper.selectOne(new QueryWrapper<Position>().eq("name",name));
    }
}
